import time

from bilibili import BliBli
from douyin import DouYin
from redis_bilibili import RedisBiliBili

from settings import *


if __name__ == '__main__':
    R = RedisBiliBili()
    B = BliBli(
        data_id=BILIBILI_DATA_ID,
        cf=BILIBILI_CF_ID
    )
    D = DouYin(
        cookie=COOKIE,
        csrf_token=CSRF_TOKEN
    )
    while True:
        data = R.get_msg()
        print(data)
        if data:
            D.run(data)
            B.run(data)
        else:
            time.sleep(3)

